﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="myWented.aspx.cs" Inherits="myWented" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <h2>我的通緝令清單</h2>
        <asp:MultiView ID="MultiView1" runat="server">
            <asp:View ID="View1" runat="server">
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="WId" 
                    DataSourceID="SqlDataSource1">
                    <Columns>
                        <asp:BoundField DataField="WId" HeaderText="通緝編號" ReadOnly="True" 
                            SortExpression="WId" />
                        <asp:BoundField DataField="WGName" HeaderText="通緝商品" SortExpression="WGName" />
                        <asp:BoundField DataField="Expr11" HeaderText="數量" SortExpression="Expr11" />
                        <asp:BoundField DataField="Expr17" HeaderText="預算" SortExpression="Expr17" />
                        <asp:BoundField DataField="HCName" HeaderText="狀態" SortExpression="HCName" />
                        <asp:BoundField DataField="Expr2" HeaderText="發布時間" SortExpression="Expr2" 
                            DataFormatString="{0:d}" />
                        <asp:BoundField DataField="Expr3" HeaderText="結束時間" SortExpression="Expr3" 
                            DataFormatString="{0:d}" />
                        <asp:HyperLinkField DataNavigateUrlFields="WId" 
                            DataNavigateUrlFormatString="~/mywDetail.aspx?id={0}" DataTextField="WId" 
                            DataTextFormatString="連至{0}號通緝令細項" HeaderText="通緝單細項" />
                    </Columns>
                </asp:GridView>
            </asp:View>
            <asp:View ID="View2" runat="server">
                尚未新增通緝令或<asp:HyperLink ID="AddWNow" runat="server" NavigateUrl="~/wanted.aspx">現在新增</asp:HyperLink>
            </asp:View>
        </asp:MultiView>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:projectConnectionString %>" 
            onselecting="SqlDataSource1_Selecting" 
            
            SelectCommand="SELECT Wanted.WStart AS Expr2, Wanted.WEnd AS Expr3, Wanted.WGAmount AS Expr11, Wanted.WGBudget AS Expr17, Wanted.WId, HistoryCategory.HCName, Wanted.WGName FROM Wanted INNER JOIN HistoryCategory ON Wanted.HCId = HistoryCategory.HCId WHERE (Wanted.MId = @MId)">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="" Name="MId" SessionField="mid" 
                    Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
</asp:Content>

